package com.chagee.store.operation.server.event.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chagee.store.operation.server.entity.WorkOrderDO;
import com.chagee.store.operation.server.model.QueryWorkOrderParam;
import com.chagee.store.operation.server.model.bo.WorkOrderDetailBO;
import com.chagee.store.operation.server.model.param.QueryWorkOrderDetailParam;
import com.chagee.store.operation.server.model.param.StoreAppSweepQueryParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ClassName WorkOrderMapper  //类名称
 * @Description: 类描述
 * @Author: Jacky-zhan	//作者
 * @CreateDate: 2024/2/27 14:11	//创建时间
 * @UpdateUser: Jacky-zhan
 * @UpdateDate: 2024/2/27 14:11	//更新时间
 * @UpdateRemark: 更新的信息
 * @Version: 1.0    //版本号
 */

public interface WorkOrderMapper extends BaseMapper<WorkOrderDO> {


	/**
	 * 根据 门店编号和工单状态不是已完成/已过期 查询工单信息
	 *
	 * @param storeCode 门店编号
	 * @return 工单集合
	 */
	List<WorkOrderDO> selectListByCode(String storeCode);

	/**
	 * 根据工单编号查询工单信息
	 *
	 * @param workOrderNumber 工单编号
	 * @return 工单信息
	 */
	WorkOrderDO dealWorkOrder(String workOrderNumber);

	/**
	 * 创建工单时更新工单状态
	 *
	 * @param storeCode 门店编码
	 * @return true/false
	 */
	Boolean updateWhenDocumentStatusNoIn45(@Param("storeCode") String storeCode);

	/**
	 * 门店本月单据状态详情
	 *
	 * @param map
	 * @return
	 */
	List<WorkOrderDO> selectMonthOrder(@Param("map") Map<Object, String> map);

	/**
	 * 门店最近打烊工单日期
	 *
	 * @param map
	 * @return
	 */
	List<WorkOrderDO> queryOrderDate(@Param("map") Map<Object, String> map);

	/**
	 * 打烊任务工单
	 * @param request
	 * @return
	 */
	List<WorkOrderDO> selectOrderList(@Param("request") StoreAppSweepQueryParam request);

	List<WorkOrderDO> list(@Param("map") Map<Object, String> map);

	/**
	 * 通过 工单编号 + 待执行状态 查询工单信息
	 *
	 * @param workOrderNumber 工单编号
	 * @return list
	 */
	List<WorkOrderDO> selectListByWorkOrderNumber(String workOrderNumber);

	List<WorkOrderDO> selectLastMonth(@Param("storeCode") String storeCode, @Param("startDate") String startDate, @Param("endDate") String endDate);


	List<WorkOrderDO> selectListByDate(@Param("request") QueryWorkOrderParam request);

	List<WorkOrderDetailBO> queryOrderList(@Param("param") QueryWorkOrderDetailParam param);

	List<WorkOrderDO> selectWorkOrderBySupplier(@Param("storeCode") String storeCode, @Param("createTime") String createTime, @Param("supplierNo") String supplierNo);
}
